<?php defined('_JEXEC') or die('Restricted access'); ?>

<form action="index.php?<?php echo $this->component; ?>" method="post" name="adminForm">     
	<table>
		<tr>
			<td align="left" width="100%">
				<?php echo JText::_( 'Filter' ); ?>:
				<input type="text" name="search" id="search" value="<?php echo $this->escape($this->search); ?>" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
				<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
			</td>
			<td nowrap="nowrap">
                <?php echo $this->lists['state']; ?>
            </td>
		</tr>
	</table>

	<div id="tablecell">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="10">
						<?php echo JText::_( 'NUM' ); ?>
					</th>
                    <th width="20">
                        <input type="checkbox" name="toggle" value=""  onclick="checkAll(<?php echo count( $this->items ); ?>);" />
                    </th>
					<th class="title" nowrap="nowrap" width="25%">
						<?php echo JHTML::_('grid.sort',   'Name', 'name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
					</th>
					<th nowrap="nowrap" width="20%">
						<?php echo JHTML::_('grid.sort',   'Position', 'position', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
					</th>   
                    <th>
                        <?php echo JHTML::_('grid.sort',   'Title', 'title', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
                    </th>                     
                    <th width="5%" class="title" nowrap="nowrap">
                        <?php echo JHTML::_('grid.sort',   'Published', 'published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
                    </th>
                   <th width="1%" nowrap="nowrap">
                        <?php echo JHTML::_('grid.sort',   'ID', 'id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
                    </th>				
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="7">
						<?php echo $this->pageNav->getListFooter(); ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php
			$k = 0;
			for ($i=0, $n = count($this->items); $i < $n; $i++) {
				$row        =& $this->items[$i];
                $checked    = JHTML::_('grid.checkedout',   $row, $i );
                $published  = JHTML::_('grid.published', $row, $i );
                $link       = JRoute::_( 'index.php?' . $this->component . '&task=edit&cid[]='. $row->id );   
				?>
				<tr class="row<?php echo $k;?>">
					<td align="right">
						<?php echo $this->pageNav->getRowOffset( $i ); //$i+1+$this->pageNav->limitstart; ?>
					</td>
                    <td align="center">
                        <?php echo $checked; ?>
                    </td>
					<td>
                        <span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit item' );?>::<?php echo htmlspecialchars($row->name); ?>">
                            <a href="<?php echo $link  ?>"><?php echo htmlspecialchars($row->name); ?></a>
                        </span>                
					</td>
					<td>
						<?php echo $row->position; ?>
					</td> 
                    <td>
                        <?php echo $row->title; ?>
                    </td>                    
                    <td align="center">
                        <?php echo $published;?>
                    </td>
                    <td align="center">
                        <?php echo $row->id; ?>
                    </td>    					
				</tr>
				<?php
				$k = 1 - $k;
			}
			?>
			</tbody>
		</table>
	</div>

	<input type="hidden" name="option" value="com_mwc_employee" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
    <input type="hidden" name="boxchecked" value="0" />
    <?php echo JHTML::_( 'form.token' ); ?>   
</form>

